import axios from 'axios'
// const axios = require('axios');

// 设置基础url,与server/bin/www.js文件中PORT对应
const baseURL = 'http://localhost:2266'
axios.defaults.baseURL = baseURL

// 添加请求拦截器
axios.interceptors.request.use(
    (config) => {
        return config;
    },
    (error) => {
        return Promise.reject(error);
    }
);


axios.interceptors.response.use(
    (config) => {
        console.log('config', config)
        return config.data;

    },
    (error) => {
        return Promise.reject(error);
    }
)

// module.exports = axios


export default axios
